﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Design;

namespace FriendsNearby.Services
{
	public static class Extensions
	{
		public static TService GetService<TService>(this IServiceProvider serviceProvider)
		{
			return (TService)serviceProvider.GetService(typeof(TService));
		}

		public static TImplementation GetService<TService, TImplementation>(this IServiceProvider serviceProvider)
		{
			return (TImplementation)serviceProvider.GetService(typeof(TService));
		}

		public static void AddService<TService>(this IServiceContainer serviceContainer, TService instance)
		{
			serviceContainer.AddService(typeof(TService), instance);
		}
	}
}
